home *** CD-ROM | disk | FTP | other *** search
- NNCONV.MOD - Convert your old NN*.NET files to new format...
- Bad Dude #1 @9981
- Friday, December 6, 1991 at 7:52 pm
- The following post will be the UUencoded NNCONV.EXE file. They are both
- the same mod; it is up to you if you want to compile yourself or just UUdecode
- it.
-
- Compile this, and place in your main BBS DATA directory, and run it. If
- you already have created an NNALL.NET file, it will still add your old
- NN*.NET files to the NNALL.NET file, but you may want to check and make sure
- that you dont get duplicates. After running this, and making sure there are
- no errors, you can delete your old NN#####.NET files. If you have problems
- or comments, please send mail to me at 1@9981. Thanks!
-
- NOTE: You MUST have WWIV v4.20e (Revision E) for this mod to work.
-
- -------------------------------------------------------------------------------
- /* NNCONV.MOD by Bad Dude (1@9981); Convert old NN*.NET files to new NNALL.NET
- format. December 6, 1991 */
-
- #include <stdio.h>
- #include <dir.h>
-
- void main(void)
- {
- int i=0,i1=0,done;
- char s[12],s1[12];
- struct ffblk ffblk;
- FILE *oldnn, *newnn;
-
- done = findfirst("NN*.NET",&ffblk,0);
- if (strcmp(ffblk.ff_name,"NNALL.NET")==0)
- done = findnext(&ffblk);
-
- if ((newnn = fopen("NNALL.NET","at")) == NULL)
- {
- printf("Error opening NNALL.NET");
- exit (1);
- }
-
- printf("NNALL.NET:\n");
- while (!done)
- {
- while (ffblk.ff_name[i] != NULL)
- {
- if (ffblk.ff_name[i] >= '0' && ffblk.ff_name[i] <= '9')
- {
- s[i1]=ffblk.ff_name[i];
- i1++;
- }
- i++;
- }
- s[i1]=0;
- i=0;
- i1=0;
-
- if((oldnn = fopen(ffblk.ff_name,"rt")) == NULL)
- {
- printf("Error opening %s.\n",ffblk.ff_name);
- exit(1);
- }
-
- fgets(s1,6,oldnn);
- fclose(oldnn);
-
- printf("%s %s",s,s1);
- fprintf(newnn, "%s %s",s,s1);
-
- done = findnext(&ffblk);
- if (strcmp(ffblk.ff_name,"NNALL.NET")==0)
- done = findnext(&ffblk);
- }
- fclose(newnn);
- }